/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PerGUI.java
 *
 * Created on 31-03-2011, 08:37:19
 */

package GUIlayer;
import Controllayer.*;
import Modellayer.*;
import java.util.ArrayList;
/**
 *
 * @author Engel
 */
public class PerGUI extends javax.swing.JFrame {
ProductCtr productCtr;
CustomerCtr customerCtr;
InvoiceCtr invoiceCtr;
OrderCtr orderCtr;
ArrayList<SalesLineItem> saleLine;
    /** Creates new form PerGUI */
    public PerGUI() {
		productCtr = new ProductCtr();
		customerCtr = new CustomerCtr();
		invoiceCtr = new InvoiceCtr();
		orderCtr = new OrderCtr();
		saleLine = new ArrayList<SalesLineItem>();
        initComponents();
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Tab2 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jPanel11 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        TBProductName = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        TBProductPurchasePrice = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        TBProductSalesPrice = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        TBProductRentPrice = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        TBProductCountry = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        TBProductMinStock = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        TBProductMaxStock = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        TBProductCurStock = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        TBProductType = new javax.swing.JTextField();
        TBProductID = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        BTNFindProduct = new javax.swing.JButton();
        BTNDeleteProduct = new javax.swing.JButton();
        BTNCreateProduct = new javax.swing.JButton();
        BTNUpdateProduct = new javax.swing.JButton();
        BTNClearText2 = new javax.swing.JButton();
        jPanel13 = new javax.swing.JPanel();
        TBProductSupplierID = new javax.swing.JTextField();
        TBProductSupplierCountry = new javax.swing.JTextField();
        TBProductSupplierPhoneNo = new javax.swing.JTextField();
        TBProductSupplierAddress = new javax.swing.JTextField();
        TBProductSupplierName = new javax.swing.JTextField();
        TBProductSupplierEmail = new javax.swing.JTextField();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        TBCustomerName = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        TBCustomerAddress = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        TBCustomerPhone = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        TBCustomerCity = new javax.swing.JTextField();
        TBCustomerZip = new javax.swing.JTextField();
        TBCustomerID = new javax.swing.JTextField();
        jLabel37 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        jPanel10 = new javax.swing.JPanel();
        BTNClearText = new javax.swing.JButton();
        BTNCreateCustomer = new javax.swing.JButton();
        BTNDeleteCustomer = new javax.swing.JButton();
        BTNFindCustomer = new javax.swing.JButton();
        BTNUpdateCustomer = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        TBOrderDate = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        TBOrderDeliveryDate = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        TBOrderDeliveryStatus = new javax.swing.JTextField();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        TBOrderID = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        TBOrderInvoiceNumber = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        TBOrderPaymentDate = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        TBOrderInvoiceStatus = new javax.swing.JTextField();
        jLabel51 = new javax.swing.JLabel();
        BTNCreateOrder = new javax.swing.JButton();
        BTNDeleteOrder = new javax.swing.JButton();
        BTNFindOrder = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        TBOrderCustomerName = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        TBOrderCustomerAddress = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        TBOrderCustomerPhone = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        TBOrderCustomerZip = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        TBOrderCustomerCity = new javax.swing.JTextField();
        jLabel45 = new javax.swing.JLabel();
        TBOrderCustomerID = new javax.swing.JTextField();
        jLabel49 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jLabel28 = new javax.swing.JLabel();
        TBOrderProductName = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        TBOrderProductPurchPrice = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();
        TBOrderProductSalesPrice = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        TBOrderProductRentPrice = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        TBOrderProductType = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        TBOrderProductMinStock = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        TBOrderProductMaxStock = new javax.swing.JTextField();
        jLabel35 = new javax.swing.JLabel();
        TBOrderProductCurStock = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        TBOrderProductCountry = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        TBOrderProductAmount = new javax.swing.JTextField();
        BTNNextProduct = new javax.swing.JButton();
        BTNPreviousProduct = new javax.swing.JButton();
        jLabel44 = new javax.swing.JLabel();
        TBOrderProductID = new javax.swing.JTextField();
        jLabel50 = new javax.swing.JLabel();
        BTNPreviousProduct1 = new javax.swing.JButton();
        BTNPreviousProduct2 = new javax.swing.JButton();
        BTNOrderClearText = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel11.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel6.setText("Name");

        jLabel7.setText("Purchase Price");

        jLabel8.setText("Sales Price");

        jLabel9.setText("Rent Price");

        jLabel10.setText("Country Of Origin");

        jLabel11.setText("Minimum Stock");

        jLabel12.setText("Maximum Stock");

        jLabel14.setText("Current Stock");

        jLabel13.setText("Type");

        jLabel21.setText("ID");

        jLabel46.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel46.setText("Product");

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(TBProductCountry, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(TBProductName, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                                    .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(TBProductPurchasePrice, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE)
                                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(TBProductSalesPrice, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE)
                                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(TBProductRentPrice, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel21)
                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                        .addComponent(jLabel12)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 341, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLabel11)
                                    .addComponent(TBProductMinStock, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE)
                                    .addComponent(TBProductMaxStock, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE)
                                    .addComponent(TBProductCurStock, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE)
                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                        .addComponent(jLabel14)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 348, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(TBProductType, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE)
                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                        .addComponent(jLabel13)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 390, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(TBProductID, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE)))))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(258, 258, 258)
                        .addComponent(jLabel46)))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                .addComponent(jLabel46)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductMinStock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductMaxStock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductCurStock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(jLabel21))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(TBProductName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(TBProductID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductPurchasePrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductSalesPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductRentPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductCountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel12.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        BTNFindProduct.setText("Find Product");
        BTNFindProduct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNFindProductActionPerformed(evt);
            }
        });

        BTNDeleteProduct.setText("Delete Product");
        BTNDeleteProduct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNDeleteProductActionPerformed(evt);
            }
        });

        BTNCreateProduct.setText("Create Product");
        BTNCreateProduct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNCreateProductActionPerformed(evt);
            }
        });

        BTNUpdateProduct.setText("Update Product");
        BTNUpdateProduct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNUpdateProductActionPerformed(evt);
            }
        });

        BTNClearText2.setText("Clear Text");
        BTNClearText2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNClearText2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(BTNClearText2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNDeleteProduct, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNCreateProduct, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNFindProduct, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNUpdateProduct, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(BTNFindProduct)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNDeleteProduct)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNCreateProduct)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNUpdateProduct)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNClearText2)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel13.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel38.setText("SupplierID");

        jLabel39.setText("Country");

        jLabel40.setText("Name");

        jLabel41.setText("Address");

        jLabel42.setText("PhoneNo");

        jLabel43.setText("Email");

        jLabel47.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel47.setText("Supplier");

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(TBProductSupplierCountry)
                                .addComponent(TBProductSupplierID, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel38)
                            .addComponent(jLabel39))
                        .addGap(37, 37, 37)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(TBProductSupplierPhoneNo)
                                .addComponent(TBProductSupplierName, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel40)
                            .addComponent(jLabel42))
                        .addGap(39, 39, 39)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel43)
                            .addComponent(jLabel41)
                            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(TBProductSupplierEmail)
                                .addComponent(TBProductSupplierAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGap(246, 246, 246)
                        .addComponent(jLabel47)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                .addComponent(jLabel47)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel38)
                    .addComponent(jLabel40)
                    .addComponent(jLabel41))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(TBProductSupplierAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel43)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductSupplierEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(TBProductSupplierName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11)
                        .addComponent(jLabel42)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductSupplierPhoneNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(TBProductSupplierID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11)
                        .addComponent(jLabel39)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TBProductSupplierCountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(78, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap(333, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );

        Tab2.addTab("Product", jPanel2);

        jPanel9.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel1.setText("Name");

        jLabel3.setText("Address");

        jLabel2.setText("Phone Number");

        jLabel4.setText("Zip Code");

        jLabel5.setText("City");

        jLabel37.setText("ID");

        jLabel48.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel48.setText("Customer");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(TBCustomerAddress, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
                    .addComponent(TBCustomerName, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 310, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel2)
                    .addComponent(TBCustomerPhone, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(TBCustomerZip, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
                    .addComponent(jLabel5)
                    .addComponent(TBCustomerCity, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
                    .addComponent(TBCustomerID, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jLabel37)
                        .addGap(118, 118, 118)
                        .addComponent(jLabel48)))
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addContainerGap(31, Short.MAX_VALUE)
                        .addComponent(jLabel37)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel48)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(TBCustomerID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBCustomerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(13, 13, 13)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(TBCustomerAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBCustomerPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBCustomerZip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBCustomerCity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        BTNClearText.setText("Clear Text");
        BTNClearText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNClearTextActionPerformed(evt);
            }
        });

        BTNCreateCustomer.setText("Create Customer");
        BTNCreateCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNCreateCustomerActionPerformed(evt);
            }
        });

        BTNDeleteCustomer.setText("Delete Customer");
        BTNDeleteCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNDeleteCustomerActionPerformed(evt);
            }
        });

        BTNFindCustomer.setText("Find Customer");
        BTNFindCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNFindCustomerActionPerformed(evt);
            }
        });

        BTNUpdateCustomer.setText("Update Customer");
        BTNUpdateCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNUpdateCustomerActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(BTNUpdateCustomer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNFindCustomer, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNDeleteCustomer, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNCreateCustomer, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BTNClearText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(BTNFindCustomer)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNDeleteCustomer)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNCreateCustomer)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNClearText)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNUpdateCustomer)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(318, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(460, Short.MAX_VALUE))
        );

        Tab2.addTab("Customer", jPanel1);

        jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel17.setText("Date");

        TBOrderDate.setText("ja");

        jLabel20.setText("Delivery Date");

        TBOrderDeliveryDate.setText("nej");

        jLabel19.setText("Delivery Status");

        TBOrderDeliveryStatus.setText("maaske");

        jLabel52.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel52.setText("Sales Order");

        jLabel53.setText("Sales Order ID");

        TBOrderID.setText("1");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(TBOrderDate, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
                    .addComponent(jLabel17)
                    .addComponent(jLabel20)
                    .addComponent(jLabel19)
                    .addComponent(TBOrderDeliveryDate, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
                    .addComponent(TBOrderDeliveryStatus, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel53)
                        .addGap(359, 359, 359))
                    .addComponent(TBOrderID, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
                    .addComponent(jLabel52))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel52)
                .addGap(13, 13, 13)
                .addComponent(jLabel53)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel17)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderDeliveryDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderDeliveryStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(20, Short.MAX_VALUE))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel16.setText("Invoice Number");

        TBOrderInvoiceNumber.setText("1");

        jLabel22.setText("Payment Date");

        TBOrderPaymentDate.setText("qwe");

        jLabel23.setText("Status");

        TBOrderInvoiceStatus.setText("ewq");

        jLabel51.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel51.setText("Invoice");

        BTNCreateOrder.setText("Create Order");
        BTNCreateOrder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNCreateOrderActionPerformed(evt);
            }
        });

        BTNDeleteOrder.setText("Delete Order");
        BTNDeleteOrder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNDeleteOrderActionPerformed(evt);
            }
        });

        BTNFindOrder.setText("Find Order");
        BTNFindOrder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNFindOrderActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TBOrderInvoiceNumber, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
                            .addComponent(jLabel16)
                            .addComponent(jLabel22)
                            .addComponent(jLabel23)
                            .addComponent(TBOrderPaymentDate, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
                            .addComponent(TBOrderInvoiceStatus, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel51)
                                .addGap(28, 28, 28))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(BTNCreateOrder, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                            .addComponent(BTNDeleteOrder, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                            .addComponent(BTNFindOrder, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel51)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel16)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderInvoiceNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel22)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderPaymentDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderInvoiceStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNCreateOrder)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNDeleteOrder)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTNFindOrder)
                .addContainerGap(64, Short.MAX_VALUE))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel15.setText("Customer Name");

        TBOrderCustomerName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TBOrderCustomerNameActionPerformed(evt);
            }
        });

        jLabel24.setText("Address");

        jLabel25.setText("Phone Number");

        jLabel26.setText("Zip Code");

        jLabel27.setText("City");

        jLabel45.setText("Customer ID");

        TBOrderCustomerID.setText("1");
        TBOrderCustomerID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TBOrderCustomerIDActionPerformed(evt);
            }
        });

        jLabel49.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel49.setText("Customer");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TBOrderCustomerCity, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                            .addComponent(TBOrderCustomerZip, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                            .addComponent(TBOrderCustomerAddress, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                            .addComponent(TBOrderCustomerName, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                            .addComponent(jLabel25)
                            .addComponent(jLabel24)
                            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel27)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                                    .addComponent(jLabel26)
                                    .addGap(17, 17, 17)))
                            .addComponent(jLabel15)
                            .addComponent(TBOrderCustomerPhone, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                            .addComponent(TBOrderCustomerID, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                            .addComponent(jLabel45)))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(74, 74, 74)
                        .addComponent(jLabel49)))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addComponent(jLabel49)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel45)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderCustomerID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel15)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderCustomerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel24)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderCustomerAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel25)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderCustomerPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(13, 13, 13)
                .addComponent(jLabel26)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(TBOrderCustomerZip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel27)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderCustomerCity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel28.setText("Product Name");

        jLabel29.setText("Purchase Price");

        jLabel30.setText("Sales Price");

        jLabel31.setText("Rent Price");

        jLabel36.setText("Type");

        jLabel33.setText("Minimum Stock");

        jLabel34.setText("Maximum Stock");

        jLabel35.setText("Current Stock");

        jLabel32.setText("Country Of Origin");

        jLabel18.setText("Amount");

        TBOrderProductAmount.setText("23");

        BTNNextProduct.setText("Next Product");

        BTNPreviousProduct.setText("Previous Product");

        jLabel44.setText("Product ID");

        TBOrderProductID.setText("1");

        jLabel50.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel50.setText("Product");

        BTNPreviousProduct1.setText("Add Product");

        BTNPreviousProduct2.setText("Delete Product");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel35)
                    .addComponent(jLabel34)
                    .addComponent(jLabel33)
                    .addComponent(jLabel32)
                    .addComponent(jLabel18)
                    .addComponent(TBOrderProductMaxStock, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductCurStock, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductMinStock, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductAmount, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(jLabel28)
                    .addComponent(jLabel29, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(jLabel30)
                    .addComponent(jLabel31)
                    .addComponent(jLabel36)
                    .addComponent(TBOrderProductType, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductRentPrice, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductSalesPrice, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductPurchPrice, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductCountry, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(TBOrderProductName, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addComponent(jLabel44)
                    .addComponent(TBOrderProductID, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(108, 108, 108)
                        .addComponent(jLabel50))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(BTNPreviousProduct1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(BTNNextProduct, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(BTNPreviousProduct2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(BTNPreviousProduct, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 119, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel50)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel44)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel28)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductPurchPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel30)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductSalesPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel31)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductRentPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel36)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel33)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductMinStock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(jLabel34)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductMaxStock, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel35)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductCurStock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel32)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductCountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TBOrderProductAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BTNNextProduct)
                    .addComponent(BTNPreviousProduct))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BTNPreviousProduct1)
                    .addComponent(BTNPreviousProduct2))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        BTNOrderClearText.setText("Clear Text");
        BTNOrderClearText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNOrderClearTextActionPerformed(evt);
            }
        });

        jScrollPane1.setViewportView(jList1);

        jButton1.setText("Find SalesLineItems");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(BTNOrderClearText, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(BTNOrderClearText, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton1)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(64, Short.MAX_VALUE))
        );

        Tab2.addTab("Order", jPanel3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(Tab2, javax.swing.GroupLayout.DEFAULT_SIZE, 827, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Tab2, javax.swing.GroupLayout.PREFERRED_SIZE, 892, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void BTNUpdateProductActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNUpdateProductActionPerformed
	{//GEN-HEADEREND:event_BTNUpdateProductActionPerformed
		ProductCtr prodCtr = new ProductCtr();
                String name = TBProductName.getText();
                String countryOfOrigin = TBProductCountry.getText();
                String type = TBProductType.getText();

                String address = TBProductSupplierAddress.getText();
                String supName = TBProductSupplierName.getText();
                String email = TBProductSupplierEmail.getText();
                String phoneno = TBProductSupplierPhoneNo.getText();
                String country = TBProductSupplierCountry.getText();

                double purchasePrice = Double.parseDouble(TBProductPurchasePrice.getText());
                double rentPrice = Double.parseDouble(TBProductRentPrice.getText());
                double salesPrice = Double.parseDouble(TBProductSalesPrice.getText());
                int minStock = Integer.parseInt(TBProductMinStock.getText());
                int maxStock = Integer.parseInt(TBProductMaxStock.getText());
                int currentStock = Integer.parseInt(TBProductCurStock.getText());
				int ID = Integer.parseInt(TBProductID.getText());
                int result = prodCtr.updateProduct(ID, name, purchasePrice, salesPrice, rentPrice, countryOfOrigin, minStock, maxStock, currentStock, type);

           if(result == 1)
           {


            }
            else{
                  jLabel9.setText("Problem with update");
               }
	}//GEN-LAST:event_BTNUpdateProductActionPerformed

	private void BTNFindProductActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNFindProductActionPerformed
	{//GEN-HEADEREND:event_BTNFindProductActionPerformed
		Product product = productCtr.findProduct(Integer.parseInt(TBProductID.getText()), true);
		TBProductName.setText(product.getName());
		TBProductPurchasePrice.setText(Double.toString(product.getPurchasePrice()));
		TBProductRentPrice.setText(Double.toString(product.getRentPrice()));
		TBProductSalesPrice.setText(Double.toString(product.getSalesPrice()));
		TBProductCountry.setText(product.getCountryOfOrigin());
		TBProductMinStock.setText(Integer.toString(product.getMinStock()));
		TBProductMaxStock.setText(Integer.toString(product.getMaxStock()));
		TBProductCurStock.setText(Integer.toString(product.getCurrentStock()));
		TBProductType.setText(product.getType());
		TBProductSupplierAddress.setText(product.getSupplier().getAddress());
		TBProductSupplierID.setText(Integer.toString(product.getSupplier().getSupplierID()));
		TBProductSupplierName.setText(product.getSupplier().getName());
		TBProductSupplierEmail.setText(product.getSupplier().getEmail());
		TBProductSupplierPhoneNo.setText(Integer.toString(product.getSupplier().getPhoneno()));
		TBProductSupplierCountry.setText(product.getSupplier().getCountry());
		// TODO add your handling code here:
	}//GEN-LAST:event_BTNFindProductActionPerformed

	private void BTNFindCustomerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNFindCustomerActionPerformed
	{//GEN-HEADEREND:event_BTNFindCustomerActionPerformed
		Customer customer = customerCtr.findCustomer(Integer.parseInt(TBCustomerID.getText()), true);
		TBCustomerName.setText(customer.getName());
		TBCustomerAddress.setText(customer.getAddress());
		TBCustomerPhone.setText(Integer.toString(customer.getPhoneno()));
		TBCustomerCity.setText(customer.getCity().getCity());
		TBCustomerZip.setText(Integer.toString(customer.getCity().getOdeZipC()));
		// TODO add your handling code here:
	}//GEN-LAST:event_BTNFindCustomerActionPerformed

	private void BTNClearTextActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNClearTextActionPerformed
	{//GEN-HEADEREND:event_BTNClearTextActionPerformed
		TBCustomerName.setText("");
		TBCustomerID.setText("");
		TBCustomerAddress.setText("");
		TBCustomerCity.setText("");
		TBCustomerZip.setText("");
		TBCustomerPhone.setText("");
                



		
		// TODO add your handling code here:
	}//GEN-LAST:event_BTNClearTextActionPerformed

	private void BTNDeleteCustomerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNDeleteCustomerActionPerformed
	{//GEN-HEADEREND:event_BTNDeleteCustomerActionPerformed
		customerCtr.deleteCustomer(Integer.parseInt(TBCustomerID.getText()));
		// TODO add your handling code here:
	}//GEN-LAST:event_BTNDeleteCustomerActionPerformed

	private void BTNCreateCustomerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNCreateCustomerActionPerformed
	{//GEN-HEADEREND:event_BTNCreateCustomerActionPerformed
		customerCtr.insertNew(new Customer(TBCustomerName.getText(), TBCustomerAddress.getText(), new City(TBCustomerCity.getText(), Integer.parseInt(TBCustomerZip.getText())), Integer.parseInt(TBCustomerPhone.getText())));
		// TODO add your handling code here:
	}//GEN-LAST:event_BTNCreateCustomerActionPerformed

	private void BTNDeleteProductActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNDeleteProductActionPerformed
	{//GEN-HEADEREND:event_BTNDeleteProductActionPerformed
		productCtr.deleteProduct(Integer.parseInt(TBProductID.getText()));
		// TODO add your handling code here:
	}//GEN-LAST:event_BTNDeleteProductActionPerformed

	private void BTNCreateProductActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNCreateProductActionPerformed
	{//GEN-HEADEREND:event_BTNCreateProductActionPerformed
		productCtr.insertNew(new Product(new Supplier(productCtr.findSupplier(Integer.parseInt(TBProductSupplierID.getText()))), TBProductName.getText(), Double.parseDouble(TBProductPurchasePrice.getText()) , Double.parseDouble(TBProductSalesPrice.getText()), Double.parseDouble(TBProductRentPrice.getText()), TBProductCountry.getText(), Integer.parseInt(TBProductMinStock.getText()), Integer.parseInt(TBProductMaxStock.getText()), Integer.parseInt(TBProductCurStock.getText()), TBProductType.getText()));
		//supplier er ikke med endnu
		// TODO add your handling code here:
	}//GEN-LAST:event_BTNCreateProductActionPerformed

        private void BTNOrderClearTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNOrderClearTextActionPerformed
            TBOrderCustomerName.setText("");
            TBOrderCustomerID.setText("");
            TBOrderCustomerAddress.setText("");
            TBOrderCustomerCity.setText("");
            TBOrderCustomerZip.setText("");
            TBOrderCustomerPhone.setText("");
            TBOrderProductName.setText("");
            TBOrderProductPurchPrice.setText("");
            TBOrderProductRentPrice.setText("");
            TBOrderProductSalesPrice.setText("");
            TBOrderProductCountry.setText("");
            TBOrderProductMinStock.setText("");
            TBOrderProductMaxStock.setText("");
            TBOrderProductCurStock.setText("");
            TBOrderProductType.setText("");
            TBOrderProductID.setText("");
            TBOrderDate.setText("");
            TBOrderDeliveryDate.setText("");
            TBOrderDeliveryStatus.setText("");
            TBOrderInvoiceNumber.setText("");
            TBOrderPaymentDate.setText("");
            TBOrderInvoiceStatus.setText("");

        }//GEN-LAST:event_BTNOrderClearTextActionPerformed

        private void TBOrderCustomerNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TBOrderCustomerNameActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_TBOrderCustomerNameActionPerformed

        private void TBOrderCustomerIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TBOrderCustomerIDActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_TBOrderCustomerIDActionPerformed

		private void BTNFindOrderActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNFindOrderActionPerformed
		{//GEN-HEADEREND:event_BTNFindOrderActionPerformed
//			Invoice invoiceObj = invoiceCtr.findInvoice(Integer.parseInt(TBOrderInvoiceNumber.getText()), true);
//			TBOrderPaymentDate.setText(invoiceObj.getPaymentDate());
//			TBOrderInvoiceStatus.setText(invoiceObj.getStatus());
//			TBOrderID.setText(Integer.toString(invoiceObj.getOrder().getSalesOrderID()));
//                        TBOrderCustomerID.setText(Integer.toString(invoiceObj.getOrder().getCustomer().getID()));

			SalesOrder orderObj = orderCtr.findSalesOrder(Integer.parseInt(TBOrderID.getText()), true);
			TBOrderDate.setText(orderObj.getDato());
			TBOrderDeliveryDate.setText(orderObj.getDeliveryDate());
			TBOrderDeliveryStatus.setText(orderObj.getDeliveryStatus());
			TBOrderCustomerID.setText(Integer.toString(orderObj.getCustomer().getID()));
			TBOrderProductID.setText(Integer.toString(orderObj.getSalesLine().getProduct().getProductID()));

			Customer customer = customerCtr.findCustomer(Integer.parseInt(TBOrderCustomerID.getText()), true);
			TBOrderCustomerName.setText(customer.getName());
			TBOrderCustomerAddress.setText(customer.getAddress());
			TBOrderCustomerPhone.setText(Integer.toString(customer.getPhoneno()));
			TBOrderCustomerZip.setText(Integer.toString(customer.getCity().getOdeZipC()));
			TBOrderCustomerCity.setText(customer.getCity().getCity());

//			Product product = productCtr.findProduct(orderObj.getSalesLine().getProduct().getProductID(), false);
//			TBOrderProductName.setText(product.getName());
//			TBOrderProductPurchPrice.setText(Double.toString(product.getPurchasePrice()));
//			TBOrderProductSalesPrice.setText(Double.toString(product.getSalesPrice()));
//			TBOrderProductRentPrice.setText(Double.toString(product.getRentPrice()));
//			TBOrderProductType.setText(product.getType());
//			TBOrderProductMinStock.setText(Integer.toString(product.getMinStock()));
//			TBOrderProductMaxStock.setText(Integer.toString(product.getMaxStock()));
//			TBOrderProductCurStock.setText(Integer.toString(product.getCurrentStock()));
//			TBOrderProductCountry.setText(product.getCountryOfOrigin());
//			TBOrderProductAmount.setText(Integer.toString(orderObj.getSalesLine().getAmount()));


			// skal finde ALT!!!!
			// TODO add your handling code here:
		}//GEN-LAST:event_BTNFindOrderActionPerformed

		private void BTNClearText2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNClearText2ActionPerformed
		{//GEN-HEADEREND:event_BTNClearText2ActionPerformed
			// TODO add your handling code here:
		}//GEN-LAST:event_BTNClearText2ActionPerformed

		private void BTNUpdateCustomerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNUpdateCustomerActionPerformed
		{//GEN-HEADEREND:event_BTNUpdateCustomerActionPerformed
			CustomerCtr customerCtr = new CustomerCtr();
                        Customer customer = customerCtr.findCustomer(Integer.parseInt(TBCustomerID.getText()), true);
                        String name = TBCustomerName.getText();
                        String address = TBCustomerAddress.getText();
                        int phoneNo = Integer.parseInt(TBCustomerPhone.getText());
                        int odeZipC = Integer.parseInt(TBCustomerZip.getText());

                        customerCtr.updateCustomer(name, address, phoneNo, odeZipC);
		}//GEN-LAST:event_BTNUpdateCustomerActionPerformed

		private void BTNDeleteOrderActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNDeleteOrderActionPerformed
		{//GEN-HEADEREND:event_BTNDeleteOrderActionPerformed
			invoiceCtr.deleteInvoice(Integer.parseInt(TBOrderInvoiceNumber.getText()));
			orderCtr.deleteSalesOrder(Integer.parseInt(TBOrderID.getText()));
			
			// TODO add your handling code here:
		}//GEN-LAST:event_BTNDeleteOrderActionPerformed

		private void BTNCreateOrderActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BTNCreateOrderActionPerformed
		{//GEN-HEADEREND:event_BTNCreateOrderActionPerformed
			String payment = TBOrderPaymentDate.getText();
			String status = TBOrderInvoiceStatus.getText();
			
			String date = TBOrderDate.getText();
			String deliveryDate = TBOrderDeliveryDate.getText();
			String deliveryStatus = TBOrderDeliveryStatus.getText();
			Customer customer = customerCtr.findCustomer(Integer.parseInt(TBOrderCustomerID.getText()), true);

			System.out.println("fejl 1");
			//int amount, Product product, SalesOrder salesOrder
			orderCtr.insertSalesOrder(new SalesOrder(customer, date, deliveryStatus, deliveryDate));
			
			SalesLineItem tempLine = new SalesLineItem(Integer.parseInt(TBOrderProductAmount.getText()), productCtr.findProduct(Integer.parseInt(TBOrderProductID.getText()), false), orderCtr.findSalesOrder(Integer.parseInt(TBOrderID.getText()), false));
			orderCtr.insertSalesLine(tempLine);

			orderCtr.updateOrder(Integer.parseInt(TBOrderID.getText()), customer, tempLine, date, Integer.parseInt(TBOrderProductAmount.getText()), deliveryStatus, deliveryDate);

			saleLine = orderCtr.findSalesLine(Integer.parseInt(TBOrderID.getText()));

			invoiceCtr.insertInvoice(new Invoice(Integer.parseInt(TBOrderInvoiceNumber.getText()), payment, status, orderCtr.findSalesOrder(Integer.parseInt(TBOrderID.getText()), true)));
			// DENNE VIRKER IKKE!!! WARNING!!! DONT FUCKING TOUCH!!!
		}//GEN-LAST:event_BTNCreateOrderActionPerformed

                private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

                     int salesOrderID = Integer.parseInt(TBOrderID.getText());
//                     if (salesOrderID.length() == 0){
//                     //write error
//                    jLabel9.setText("Please insert ssn on the employee");
//                    }
//                    else {
                      ArrayList<SalesLineItem> salesLine = orderCtr.findSalesLine(salesOrderID);
                      System.out.println("salesLine list 1: "+salesLine);
                      buildList(salesLine);
                      System.out.println("salesLine list 3 "+salesLine);
                       // }               // TODO add your handling code here:
                }//GEN-LAST:event_jButton1ActionPerformed

                private void buildList(ArrayList<SalesLineItem> salesLine)
                 {
                    String[] projects = new String[salesLine.size()];
                    int index = 0;
                    System.out.println("salesLine list 2: "+salesLine);
                    for(SalesLineItem wobj : salesLine)
                    {

                        String name = wobj.getProduct().getName();
                        System.out.println("product name 1: "+ wobj.getProduct().getName());
//                        if(name.length() < 15){
//                            int length = name.length();
//                            while (length < 20)
//                            {
//                              name = name + "  ";
//                              length++;
//                            }
//                         }
                         projects[index] =(name + "   " + wobj.getAmount());
                         index++;
                    }
                    jList1.setListData(projects);
                }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PerGUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BTNClearText;
    private javax.swing.JButton BTNClearText2;
    private javax.swing.JButton BTNCreateCustomer;
    private javax.swing.JButton BTNCreateOrder;
    private javax.swing.JButton BTNCreateProduct;
    private javax.swing.JButton BTNDeleteCustomer;
    private javax.swing.JButton BTNDeleteOrder;
    private javax.swing.JButton BTNDeleteProduct;
    private javax.swing.JButton BTNFindCustomer;
    private javax.swing.JButton BTNFindOrder;
    private javax.swing.JButton BTNFindProduct;
    private javax.swing.JButton BTNNextProduct;
    private javax.swing.JButton BTNOrderClearText;
    private javax.swing.JButton BTNPreviousProduct;
    private javax.swing.JButton BTNPreviousProduct1;
    private javax.swing.JButton BTNPreviousProduct2;
    private javax.swing.JButton BTNUpdateCustomer;
    private javax.swing.JButton BTNUpdateProduct;
    private javax.swing.JTextField TBCustomerAddress;
    private javax.swing.JTextField TBCustomerCity;
    private javax.swing.JTextField TBCustomerID;
    private javax.swing.JTextField TBCustomerName;
    private javax.swing.JTextField TBCustomerPhone;
    private javax.swing.JTextField TBCustomerZip;
    private javax.swing.JTextField TBOrderCustomerAddress;
    private javax.swing.JTextField TBOrderCustomerCity;
    private javax.swing.JTextField TBOrderCustomerID;
    private javax.swing.JTextField TBOrderCustomerName;
    private javax.swing.JTextField TBOrderCustomerPhone;
    private javax.swing.JTextField TBOrderCustomerZip;
    private javax.swing.JTextField TBOrderDate;
    private javax.swing.JTextField TBOrderDeliveryDate;
    private javax.swing.JTextField TBOrderDeliveryStatus;
    private javax.swing.JTextField TBOrderID;
    private javax.swing.JTextField TBOrderInvoiceNumber;
    private javax.swing.JTextField TBOrderInvoiceStatus;
    private javax.swing.JTextField TBOrderPaymentDate;
    private javax.swing.JTextField TBOrderProductAmount;
    private javax.swing.JTextField TBOrderProductCountry;
    private javax.swing.JTextField TBOrderProductCurStock;
    private javax.swing.JTextField TBOrderProductID;
    private javax.swing.JTextField TBOrderProductMaxStock;
    private javax.swing.JTextField TBOrderProductMinStock;
    private javax.swing.JTextField TBOrderProductName;
    private javax.swing.JTextField TBOrderProductPurchPrice;
    private javax.swing.JTextField TBOrderProductRentPrice;
    private javax.swing.JTextField TBOrderProductSalesPrice;
    private javax.swing.JTextField TBOrderProductType;
    private javax.swing.JTextField TBProductCountry;
    private javax.swing.JTextField TBProductCurStock;
    private javax.swing.JTextField TBProductID;
    private javax.swing.JTextField TBProductMaxStock;
    private javax.swing.JTextField TBProductMinStock;
    private javax.swing.JTextField TBProductName;
    private javax.swing.JTextField TBProductPurchasePrice;
    private javax.swing.JTextField TBProductRentPrice;
    private javax.swing.JTextField TBProductSalesPrice;
    private javax.swing.JTextField TBProductSupplierAddress;
    private javax.swing.JTextField TBProductSupplierCountry;
    private javax.swing.JTextField TBProductSupplierEmail;
    private javax.swing.JTextField TBProductSupplierID;
    private javax.swing.JTextField TBProductSupplierName;
    private javax.swing.JTextField TBProductSupplierPhoneNo;
    private javax.swing.JTextField TBProductType;
    private javax.swing.JTabbedPane Tab2;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JList jList1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

}
